<template>
  <div
    :class="[title ? 'cardPadding' : '', 'card']"
    :style="{ height: height + 'px', width: width + 'px' }"
  >
    <div v-if="title" class="flexbet flexcolcenter cardTitle">
      <div class="flex">
        <img class="icon" src="@/assets/images/screen/titleIcon.png" alt="" />
        <div class="t">{{ title }}</div>
      </div>
      <div>
        <slot name="header"></slot>
      </div>
    </div>
    <slot></slot>
  </div>
</template>
  
<script>
export default {
  props: {
    title: String,
    height: [String, Number],
    width: {
      type: [String, Number],
      default: 600,
    },
  },
};
</script>
  
<style lang="scss" scoped>
.headerMore {
  font-family: PingFangSC, PingFang SC;
  font-weight: 500;
  font-size: 12px;
  color: #666666;
  line-height: 17px;
  font-style: normal;
}
.cardPadding {
  padding: 24px 20px 0 20px;
}
.card {
  overflow: hidden;
  border-radius: 20px;
  background: #f9f9f9;
  box-sizing: border-box;

  box-shadow: 0px 11px 24px -11px rgba(0, 0, 0, 0.23);
  border: 2px solid #f9f9f9;
  .cardTitle {
    img {
      margin-top: 3px;
      width: 18px;
      height: 18px;
    }
    .t {
      margin-left: 7px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 600;
      font-size: 20px;
      color: #333333;
      line-height: 20px;
      font-style: normal;
    }
  }
}
</style>